<style>
    .panel-fieldlist .fieldlist dd ins {
        width: 20%;
    }

    .panel-fieldlist .fieldlist dd input, .panel-fieldlist .fieldlist dd select {
        width: 100%;
    }

    /*.list-group-item {*/
    /*    display: flex;*/
    /*    align-items: center;*/
    /*    justify-content: space-between;*/
    /*}*/

    .groups {
        display: flex;
        align-items: center;
    }

    .title {
        font-weight: bold;
        font-size: 16px;
    }



    .table-goods > thead > tr > th, .table-goods > tbody > tr > th, .table-goods > thead > tr > td, .table-goods > tbody > tr > td {
        vertical-align: middle;
    }

    .order-status {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .print-flex {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    @media print {
        .electronics, .btn-print-page, .memo-operate {
            display: none;
        }
    }
</style>
<style>

.level1{
    background-color: #777777;
}
.level2{
    background-color: #2c3e50;
}
.level3{
    background-color: #3498db;
}
.level4 {
    background-color: #f39c12;
}
.level5 {
    background-color: #d62c1a;
}
.status-1{
    background-color: #777777;
}
.status0{
    background-color: #2c3e50;
}
.status1{
    background-color: #18bc9c;
}
.status2 {
    background-color: #e74c3c;
}
.status3 {
    background-color: #18bc9c;
}
.panel-intro{
    border: 1px solid #ddd;
}
.logcontent{
    min-width: 150px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    max-width:300px;
}
</style>
<div id="app">
    <div class="panel panel-default">
        <div class="panel-heading">



            <span class="pull-right" >
            {if $auth->check('workteam/task/edit')}
            <a href="workteam/task/edit/ids/{$row['id']}" class="btn-dialog" data-title="{:__('修改任务')}"><i class="fa fa-pencil"></i>
                {$row.name}
            </a>
            {else/}
                {$row.name}
            {/if}


            </span>
            <span class="label status{$row.status}">{$statusList[$row.status]}</span>
            <span class="label label-info">{$row.admin.nickname}</span>
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="col-xs-6">
                    <ul class="list-group">
                        <li class="list-group-item  text-left">
                            <a href="workteam/project/detail/ids/{$row.project_id}" class="btn-addtabs " title="{$row.project.name}">
                            <span>     {:__("项目")}：</span>
                                {$row.project.name} <span class="pull-right">{:__("详情")} &nbsp;<i class=" fa fa-angle-right"></i></span>

                            </a>


                        </li>
                        <li class="list-group-item text-left">
                            <span>     {:__("父级任务")}：</span>
                            {if $row.pid }
                            <a href="workteam/task/detail/ids/{$row.pid}" class="btn-addtabs" title="{$row.ptask.name}">{$row.ptask.name}</a>
                            {else/}
                            无
                            {/if}
                        </li>
                        <li class="list-group-item">
                            <span>     {:__("优先级")}：</span>
                            <span class="label level{$row.level}">{$levelList[$row.level]}</span>

                        </li>
                        <li class="list-group-item">{:__("计划时间")}：{:datetime($row.start_time,'Y/m/d H:s')}~{:datetime($row.end_time,'Y/m/d H:s')}</li>
                        <li class="list-group-item">{:__("可得工时")}：{$row.get_hours}</li>
                        <li class="list-group-item">{:__("计划工时")}：{$row.plan_hours}</li>

                    </ul>
                </div>
                <div class="col-xs-6">
                    <ul class="list-group">
                        <li class="list-group-item">{:__("创建时间")}：{:datetime($row.create_time,'Y/m/d H:s')}</li>
                        <li class="list-group-item">{:__("完成时间")}：{:$row.complete_time?datetime($row.complete_time,'Y/m/d H:s'):'-'}</li>
                        <li class="list-group-item">{:__("创建人")}：  {$row.cadmin?$row.cadmin.nickname:"已删除"}</li>
                        <li class="list-group-item">
                            <span>{:__("参与人员")}：</span>
                            {php}
                            $admin_arr= (new \app\admin\model\Admin())->where('id','in',$row['admin_ids'])->select();
                            {/php}
                            {volist name="admin_arr" id="vo"}
                            <span>
                                    {$vo.nickname}
                                </span>
                            {/volist}
                        </li>
                        <li class="list-group-item">
                            <span style="width: 140px;">{:__("归属部门")}：{$row.group?$row.group.name:"不存在"}</span>
                            <span class="level{$row.level}"></span>
                        </li>

                        <li class="list-group-item">
                        <span style="width: 140px;">{:__("附件")}：
                            {php}
                            $files_count=$row->files()->count()>0;
                            {/php}
                            {if $files_count>0 }
                            <a href="workteam/task/fileslist/task_id/{$row->id}" data-title="{$row.name}{:__('附件')}" class="btn-dialog"> 点击查看</a>
                            {else/}
                            无
                            {/if}
                        </span>

                        </li>


                    </ul>
                </div>
                <div class="col-xs-12">
                    {$row.content}
                </div>

            </div>
        </div>
    </div>
    <div class="panel panel-default panel-intro">
        <div class="panel-heading">
            <ul class="nav nav-tabs">

                <li class="active"><a href="#log" role="tab" data-toggle="tab">{:__('客情记录')}</a></li>
                <li><a href="#bulletin" role="tab" data-toggle="tab">{:__('任务动态')}</a></li>
                <li><a href="#forum" role="tab" data-toggle="tab">{:__('子任务')}</a></li>
                <!--<li><a href="#files12" role="tab"  data-toggle="tab">{:__('附件')}</a></li>-->

            </ul>
        </div>
        <div class="panel-body">
            <div id="myTabContent" class="tab-content">
                <div id="toolbar1" class="toolbar ">
                    <a href="javascript:;" class="btn btn-primary btn-refresh"><i class="fa fa-refresh"></i></a>
                    {if($auth->check('workteam/task/addlog'))}
                    <a href="javascript:;" data-url="workteam/task/addlog/ids/{:input('ids')}" class="btn btn-success  btn-dialog "
                       title="添加任务动态"><i class="fa fa-plus"></i> {:__('添加')}</a>
                    {/if}

                </div>
                <div id="toolbar2" class="toolbar">
                    <a href="javascript:;" class="btn btn-primary btn-refresh"><i class="fa fa-refresh"></i></a>
                    {if($auth->check('workteam/task/addchild'))}
                    <a href="javascript:;" data-url="workteam/task/addchild/ids/{:input('ids')}" class="btn btn-success  btn-dialog "
                       title="添加子任务"><i class="fa fa-plus"></i> {:__('子任务')}</a>
                    {/if}
                </div>
				<div id="toolbar3" class="toolbar">
                    <a href="javascript:;" class="btn btn-primary btn-refresh"><i class="fa fa-refresh"></i></a>
                    {if($auth->check('service/log/add'))}
                    <a href="javascript:;" data-url="{:url('service/log/add',['customer_id'=>$row->project->customer_id,'project_id'=>$row['project_id'],'task_id'=>$row['id']])}" class="btn btn-success  btn-dialog "
                       title="添加客情记录"><i class="fa fa-plus"></i> {:__('客情记录')}</a>
                    {/if}
                </div>


                <!-- 操作开始-->
                <div class="tab-pane fade" id="bulletin">
					<ul class="nav nav-tabs" id="tab-log" >
						{foreach name="typeList" item="vo" key="key"}
						<li{if $key==0} class='active'{/if}><a  href="#t-{$key}" data-filter='{"type":"{$key}"}' data-op='{"type":"="}' data-toggle="tab">{$vo}</a></li>
						{/foreach}
						<li><a  href="#t-{$key+1}" data-filter='' data-op='' data-toggle="tab">{:__('全部')}</a></li>
					</ul>
                    <table id="tablelog" class="table table-striped table-bordered table-hover table-nowrap" width="100%"></table>
                </div>
                <!-- 操作结束-->
                <!-- 子任务-->
                <div class="tab-pane fade" id="forum">
                    <table id="childtask" class="table table-striped table-bordered table-hover table-nowrap" width="100%"
                           data-operate-edit="{:$auth->check('workteam/task/edit')}"
                           data-operate-del="{:$auth->check('workteam/task/del')}"
                           data-operate-addchild="{:$auth->check('workteam/task/addchild')}"
                           data-operate-detail="{:$auth->check('workteam/task/detail')}">

                    </table>
                    <!-- 修改 amplam2018年8月13日 10:30:05--->
                </div>
                <!-- 子任务-->
                <!-- 客情记录-->
                <div class="tab-pane fade active in" id="log">
                    <table id="loglist" class="table table-striped table-bordered table-hover table-nowrap" width="100%"
                           data-operate-edit="{:$auth->check('service/log/edit')}"
                           data-operate-del="{:$auth->check('service/log/del')}"

                    </table>
                </div>
                <!-- 客情记录-->

            </div>
        </div>
    </div>

</div>

<script>
    var pid={:input('ids')};

</script>

